<html>
<head>
    <title>表格的排序</title>
    <meta content="csdn design team - meizz" name="designer"/>
</head>
<style>
    body {
        font-size: 9pt;
        padding: 0;
    }

    input {
        font-size: 9pt;
        height: 15pt;
        width: 50px;
        cursor: default;
    }

    table {
        font-size: 9pt;
        word-break: break-all;
        cursor: default;
        border: 1px solid black; 
        background-color: #eeeecc;
        border-collapse: collapse;
        border-color: #999999;
        align: center;
    }
</style>
<script language=javascript>
    function show() {
        let temp = new Array();
        let obj = document.getElementById("table1").childNodes[0];
        let objs = obj.childNodes;

        for (let i = 0; i < objs.length; i++) {
            temp[i] = new Array(objs[i].childNodes[2].innerText, objs[i]);
        }
        temp.sort(function (a, b) {
            return a[0] - b[0]
        })
        for (let i = 0; i < temp.length; i++) {
            obj.appendChild(temp[i][1])
        }

    }
</script>
<body>
<form action="/addcontent.jsp" method="post" name="myForm">
    <table align="center" border="0" cellpadding="0" cellspacing="0" id="table1" width="60%">
        <tr>
            <td align="center" width="24%"><input name="id" type="checkbox"></td>
            <td width="56%">�û�������¼���</td>
            <td width="20%">3</td>
        </tr>
        <tr>
            <td align="center" width="24%"><input name="id" type="checkbox"></td>
            <td width="56%">�ۺ����԰�</td>
            <td width="20%">2</td>
        </tr>
        <tr>
            <td align="center" width="24%"><input name="id" type="checkbox"></td>
            <td width="56%">��ʷ���ϲ�ѯ</td>
            <td width="20%">1</td>
        </tr>
    </table>
    <input name="button1" onclick=show() type="button" value="����">
</form>
</body>
</html>
